perm filename TEST10.SAI[GEM,BGB] blob
sn#032394 filedate 1973-03-30 generic text, type T, neo UTF8
00100 BEGIN "TEST10"
00200 REQUIRE "ABBREV[SYS,BGB]" SOURCE_FILE;
00300 REQUIRE "SAITRG[SYS,BGB]" SOURCE_FILE;
00400 REQUIRE "DPYIII[SYS,BGB]" SOURCE_FILE;
00500
00600 REAL X1,Y1,Z1;
00700 REAL X2,Y2,Z2;
00800 REAL X3,Y3,Z3;
00900 REAL X4,Y4,Z4;
01000 REAL X5,Y5,Z5;
01100 REAL R1,R2,R3,R4,R5;
01200 REAL A,B,T,C,S;
01300
01400 SAFE INTEGER ARRAY DPYBUF[0:600];
01500
01600 X1←X3←500;
01700
01800 WHILE TRUE DO
01900 BEGIN
02000 DPYSET(DPYBUF);
02100 AIVECT(X1,Y1);
02200 AVECT(X2,Y2);
02300 AVECT(X3,Y3);
02400 AIVECT(200,200);
02500
02600 R1 ← SQRT (X1*X1 + Y1*Y1 + Z1*Z1);
02700 R3 ← SQRT (X3*X3 + Y3*Y3 + Z3*Z3);
02800
02900 C ← (X1*X3 + Y1*Y3 + Z1*Z3)/(R1*R3);
03000
03100 α CROSS V1 INTO V3 YIELDS V4;
03200 X4 ← (Y1*Z3 - Y3*Z1);
03300 Y4 ← (X3*Z1 - X1*Z3);
03400 Z4 ← (X1*Y3 - X3*Y1);
00100 α CHEAP PLANE COEFFICIENTS;
00200 T ← X1*Y3 - X3*Y1;
00300 A ← (Z3*Y1 - Z1*Y3)/T;
00400 B ← (X3*Z1 - X1*Z3)/T;
00500
00600 α IS THE CROSS'ED POINT V4 ABOVE OR BELOW THE CCW PLANE ? ;
00700 S ← (A*X4 + B*Y4 + Z4);
00100 DPYSST(CVS(ATAN2(Y3,X3)*1800/(π*10))&" ");
00200 DPYSST(CVS((IF S<0 THEN -1 ELSE 1)*ACOS(C)*1800/(π*10)));
00250 AIVECT(200,100);DPYSST(CVG(S));
00300 DPYOUT(1);
00400 X3 ← X3 - 0.01*Y3;
00500 Y3 ← Y3 + 0.01*X3;
00600 END;
00700
00800 END "TEST10";